using System;
using System.Collections.Generic;
using System.Text;

namespace CodePlex.Resourceful.CommandLine
{
    public class ParameterInfo :  BaseInfo
    {
        private readonly bool _required;
        private readonly object _defaultValue;

        private ParameterInfo(string name, string description, bool required, object defaultValue)
            : base(name, description)
        {
            _required = required;
            _defaultValue = defaultValue;
        }

        public bool IsRequired
        {
            get
            {
                return _required;
            }
        }

        public object DefaultValue
        {
            get
            {
                return _defaultValue;
            }
        }

        public static ParameterInfo Required(string name, string description, object defaultValue)
        {
            return new ParameterInfo(name, description, true, defaultValue);
        }
        public static ParameterInfo Required(string name, string description)
        {
            return new ParameterInfo(name, description, true, null);
        }

        public static ParameterInfo Optional(string name, string description)
        {
            return Optional(name, description, null);
        }
        public static ParameterInfo Optional(string name, string description, object defaultValue)
        {
            return new ParameterInfo(name, description, false, defaultValue);
        }


    }
}
